<template>
  <div>
    <h2>TsRadio</h2>
    <p>
      性别
      <input type="radio" @input="$emit('my-input', $event.target.value)" name="gender" :checked="myValue === '1'"
        value="1">
      男
      <input type="radio" @input="$emit('my-input', $event.target.value)" name="gender" :checked="myValue === '2'"
        value="2">
      女
    </p>
  </div>
</template>
<script>
export default {
  model: { prop: 'myValue', event: 'my-input' },
  props: {
    myValue: {
      type: String,
      default: '1'
    }
  }
}
</script>